package countLetters;
/**
 *
 * @author Balan Alin
 */
public class CountLetters {
    
    /**
     * Metoda numara numarul de litere dintr-un sir
     */
    public void countLetters(String str) {
        
        if (str == null)
            return;
        
        int counter = 0;
        
        for (int i = 0; i < str.length(); i++) {

            if (Character.toString(str.charAt(i)) != null)
                counter++;
        }
        
        System.out.println("S-au introdus " + counter + " litere.");
    }

    
    public static void main(String[] args) {
        new CountLetters().countLetters("Balan Alin, Informatica. Anul 3");
    }
}
